package com.gujiangbo.redemo;

import org.junit.jupiter.api.Test;
import redis.clients.jedis.Jedis;

import java.util.HashMap;
import java.util.Map;

/**
 * zset 有序集合
 */
public class RedisZsetDemo {
    private Jedis jedis = JedisFactory.getJedis();

    /**
     * zadd key score  member [score member ...] 添加成员
     */
    @Test
    public void testZadd() {
        Map<String, Double> map = new HashMap<>();
        map.put("张三", 89.16);
        map.put("李四", 78.67);
        map.put("赵六", 99.55);
        map.put("黄炳生", 56.12);
        map.put("朱媛媛", 89.34);
        Long score = jedis.zadd("score", map);
        System.out.println(score);
    }

}
